/**
 * 我的个人中心js插件
 */

$(function(){
	$("#toindex,.logo").click(function(){
		layer.alert("去首页");
		//location.href="";
	})
	$("#myrpc").click(function(){
		location.href="personal";
	})
	$("#mygr").click(function(){
		location.href="staff";
	})
	a = function(){
		//layer.alert($("#city").val());
		$("#dizhi").text($("#city").val());
		
	}
	setInterval('a()',500);
	
	$(".mytx-padding img").mouseover(function(){
		$(this).stop().animate({
			width:"140",height:"140",top:"-15",left:"-15"
		},200)
	})
	$(".mytx-padding img").mouseout(function(){
		$(this).stop().animate({
			width:"110",height:"110",top:"0",left:"0"
		},200)
	})
	
	$(".begin div").mouseover(function(){
		$(this).css("top","-5px").css("color","red");
	})
	$(".begin div").mouseout(function(){
		$(this).css("top","0px").css("color","black");
	})
	
	$(".context-left-navigation-padding div").click(function(){
		$(this).css("background","rgb(190,222,230)");
		$(".context-left-navigation-padding div").not($(this)).css("background","white");
	})
	
	
	$(".fuwu").click(function(){
		$(".context-center-middle-padding-dd").show();
		$(".context-center-middle-padding-pj").hide();
		$(".context-center-middle-padding-bg").hide();
		$("#fuwutable").show();
		$("#pingjiatable").hide();
		$("#ordertable").hide();
		$(this).css("background","white").css("border-radius","0px");
		$(".pingjia").css("background","#F5F5F5").css("border-bottom-left-radius","20px").css("border-bottom-right-radius","0px");
		$(".dingdan").css("background","#F5F5F5").css("border-radius","0px");
		if($("#ordertable").css("display")=="block"){
			$("#ddzz").show();
		}else{
			$("#ddzz").hide();
		}
	})
	$(".pingjia").click(function(){
		$(".context-center-middle-padding-dd").show();
		$(".context-center-middle-padding-pj").hide();
		$(".context-center-middle-padding-bg").hide();
		$("#fuwutable").hide();
		$("#pingjiatable").show();
		$("#ordertable").hide();
		$(".fuwu").css("background","#F5F5F5").css("border-bottom-right-radius","20px");
		$(this).css("background","white").css("border-radius","0px");
		$(".dingdan").css("background","#F5F5F5").css("border-bottom-left-radius","20px");
		if($("#ordertable").css("display")=="block"){
			$("#ddzz").show();
		}else{
			$("#ddzz").hide();
		}
	})
	$(".dingdan").click(function(){
		$(".context-center-middle-padding-dd").show();
		$(".context-center-middle-padding-pj").hide();
		$(".context-center-middle-padding-bg").hide();
		$("#fuwutable").hide();
		$("#pingjiatable").hide();
		$("#ordertable").show();
		$(".fuwu").css("background","#F5F5F5").css("border-radius","0px");
		$(".pingjia").css("background","#F5F5F5").css("border-bottom-right-radius","20px").css("border-bottom-left-radius","0px");
		$(this).css("background","white").css("border-radius","0px");
		if($("#ordertable").css("display")=="block"){
			$("#ddzz").show();
		}else{
			$("#ddzz").hide();
		}
	})
	$("#fuwu").click(function(){
		$(".fuwu").click();
		$(".dd").click();
	})
	$("#pingjia").click(function(){
		$(".pingjia").click();
		$(".dd").click();
	})
	$("#dingdan").click(function(){
		$(".dingdan").click();
		$(".dd").click();
	})
	
	$(".dd").click(function(){
		if($(".context-center-middle-user").css("display")=="block"){
			$(".context-center-middle-user").hide(200);
			$(".context-center-top").show();
			$(".context-center-middle").show();
			$(".context-center-middle-padding-dd").show();
			$(".context-center-middle-padding-pj").hide();
			$(".context-center-middle-padding-sh").hide();
			$(".context-center-middle-padding-bg").hide();
		}else{
			$(".context-center-middle-padding-dd").show();
			$(".context-center-middle-padding-pj").hide();
			$(".context-center-middle-padding-sh").hide();
			$(".context-center-middle-padding-bg").hide();
		}
		
	})
	$(".pj").click(function(){
		if($(".context-center-middle-user").css("display")=="block"){
			$(".context-center-middle-user").hide(200);
			$(".context-center-top").show();
			$(".context-center-middle").show();
			$(".context-center-middle-padding-dd").hide();
			$(".context-center-middle-padding-pj").show();
			$(".context-center-middle-padding-sh").hide();
			$(".context-center-middle-padding-bg").hide();
		}else{
			$(".context-center-middle-padding-dd").hide();
			$(".context-center-middle-padding-pj").show();
			$(".context-center-middle-padding-sh").hide();
			$(".context-center-middle-padding-bg").hide();
		}
		
	})
	$(".sh").click(function(){
		// 打开客服聊天框
		layer.alert("即将打开客服聊天");
	})
	$(".bg").click(function(){
		if($(".context-center-middle-user").css("display")=="block"){
			$(".context-center-middle-user").hide(200);
			$(".context-center-top").show();
			$(".context-center-middle").show();
			$(".context-center-middle-padding-dd").hide();
			$(".context-center-middle-padding-pj").hide();
			$(".context-center-middle-padding-sh").hide();
			$(".context-center-middle-padding-bg").show();
		}else{
			$(".context-center-middle-padding-dd").hide();
			$(".context-center-middle-padding-pj").hide();
			$(".context-center-middle-padding-sh").hide();
			$(".context-center-middle-padding-bg").show();
		}
	})
	
	$("#myuser,#myuserr").click(function(){
		if($(".context-center-middle-user").css("display")=="none"){
			$(".context-center-top").hide(200);
			$(".context-center-middle").hide(200);
			$(".context-center-middle-user").show(200);
		}else{
			$(".context-center-top").show(200);
			$(".context-center-middle").show(200);
			$(".context-center-middle-user").hide(200);
		}
	})
	
	$("#addresss").click(function(){
		$(".booo").css("width","70px").css("left","-120px");
		$(".addresss").show();
		$(".userss").hide();
		$(".touxiangss").hide();
	})
	$("#jiben").click(function(){
		$(".booo").css("width","93px").css("left","0px");
		$(".userss").show();
		$(".touxiangss").hide();
		$(".addresss").hide();
	})
	$("#touxiang").click(function(){
		$(".booo").css("width","70px").css("left","120px");
		$(".userss").hide();
		$(".touxiangss").show();
		$(".addresss").hide();
	})
	
	$("#dd").click(function(){
		$(".dd").click();
	})
	
	$("#kefu").click(function(){
		$(".sh").click();
	})
	
	$("#updtx").mouseover(function(){
		$(this).text("提交");
	})
	$("#updtx").mouseout(function(){
		$(this).text("选好了？");
	})
	
	$("#upduser").mouseover(function(){
		$(this).text("填写后提交");
	})
	$("#upduser").mouseout(function(){
		$(this).text("要修改吗？");
	})
	
	$(".context-center-top-padding div img").mouseover(function(){
		$(this).css("top","-8px");
	})
	$(".context-center-top-padding div img").mouseout(function(){
		$(this).css("top","0px");
	})
	


	
//	$(".mousedivmsg").
	
})

//轮播
layui.use('carousel', function(){
  var carousel = layui.carousel;
  //建造实例
  carousel.render({
    elem: '#test1'
    ,width: '100%' //设置容器宽度
    ,height: '100%'
    //,arrow: 'always' //始终显示箭头
    //,anim: 'updown' //切换动画方式
  });
});




/*
// echarts 图形工具
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;

data = [["2018-07-14",131],["2018-07-15",111],["2018-07-16",64],["2018-07-17",69],["2018-07-18",88],["2018-07-19",77],["2018-07-20",83],["2018-07-21",111],["2018-07-22",57],["2018-07-23",55],["2018-07-24",60]];

var dateList = data.map(function (item) {
    return item[0];
});
var valueList = data.map(function (item) {
    return item[1];
});

option = {

    // Make gradient line here
    visualMap: [{
        show: false,
        type: 'continuous',
        seriesIndex: 0,
        min: 0,
        max: 400
    }],


    title: [{
    	padding: [18, 5],
        left: 'center',
        text: '有多少用户选择我们？',
        subtext:'单位(次)',
        textStyle:{
            fontWeight:"400",
            color:"red",
            fontStyle:"italic"
        }
    }],
    tooltip: {
        trigger: 'axis'
    },
    xAxis: [{
        data: dateList
    }],
    yAxis: [{
        splitLine: {show: false}
    }],
    grid: [{
        bottom: '20%'
    }],
    series: [{
        type: 'line',
        showSymbol: true,
        data: valueList
    }]
};;
if (option && typeof option === "object") {
    myChart.setOption(option, true);
}
*/